<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2017/1/6
 * Time: 14:11
 */

require "../vendor/autoload.php";
use Elasticsearch\Client;



$client = new Client();
$mapping = $client->indices()->getMapping(['index' => 'blog']);
print_r($mapping);
//
//$params['body']  = array('testField' => 'abc');
//$params['index'] = 'my_index';
//$params['type']  = 'my_type';
//$params['id']    = 'my_id';
// Document will be indexed to my_index/my_type/my_id
//$ret = $client->index($params);
//print_r($ret);